<?php
include_once 'inc/config.inc.php';
include_once 'inc/mysql.inc.php';
include_once 'inc/tool.ins.php';
$template['title'] = '宿舍信息查询';
$link = connect();
?>



<?php  include 'include/header.php' ?>

<div id="content" class="span10">
    <ul class="breadcrumb">
        <li>
            <i class="icon-home"></i>
            <a href="index.php">Home</a>
            <i class="icon-angle-right"></i>
        </li>
        <li><a href="#">宿舍信息查询</a></li>
    </ul>

<div class="container">
<table width="800"  class="table table-hover " >
    <tr class="success">
        <th>ID</th>
        <th>楼栋号</th>
        <th>宿舍号</th>
        <th>操作</th>
    </tr>

<?php
$query="select * from sushe ";
$result = execute($link,$query);
while($data = mysqli_fetch_assoc($result)){
$str=<<<A
    <tr align="center">
          <td class="active">{$data['id']}</td>
          <td class="info">{$data['ldh']}</td>
          <td class="warning">{$data['ssh']}</td>
          <td class="danger"> <a href="ss_select.php?id={$data['id']} & ldh={$data['ldh']} & ssh={$data['ssh']} ">居住详情</a> </td>
    </tr>


A;
 echo $str;
}

?>
  </table>
  </div>
<?php
if(isset($_GET['id'])){
       $query="select * from student where ldh='{$_GET['ldh']}' and ssh={$_GET['ssh']} ";
       $result_son = execute($link,$query);
       ?>

       <table width="800" border="2"  style="margin:60px" class="animated fadeInUpBig" >

           <tr >
                 <th>学号</th>
                 <th>姓名</th>
                 <th>专业</th>
                 <th>联系方式1</th>
           </tr>

       <?php

       while($data_son = mysqli_fetch_assoc($result_son) ){
$str1=<<<A
    <tr align="center">
          <td>{$data_son['sid']}</td>
          <td>{$data_son['name']}</td>
          <td>{$data_son['professional']}</td>
           <td>{$data_son['phone']}</td>

    </tr>

A;
 echo $str1;
       }
}
?>
</table>


<?php  include 'include/footer.php' ?>

</body>
</html>
